home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 076-100 / 084 / blitlab / readme < prev    next >
Text File  |  1995-03-13  |  8KB  |  153 lines

  1. BlitLab 1.2                        22 July 1987
  2.  
  3.     This is release 1.2, which adds access to two additional blitter
  4. flags, and corrects the line drawing algorithm.  It also includes the
  5. blit.tex documentation.  If you are interested in drawing lines, this
  6. program and its documentation now contains information which cannot be
  7. found in any of the published documentation on the blitter.
  8.  
  9.     BlitLab is a program which lets you experiment with the blitter
  10. to your hearts content, in relative safety.  It opens up a workbench
  11. window with gadgets for all of the registers of the blitter, and allows
  12. you to manipulate individual registers and perform blits on a magnified
  13. bitmap.  This documentation is sketchy, but it probably won't get much
  14. better.
  15.  
  16.     This program was written for a blitter presentation at the
  17. BADGE meeting of 16 April 1987, and it met with such approval that I
  18. decided to make it available over the net.  I wrote it for Manx C using
  19. 16 bit ints.  It should port to Lattice with a minimum of effort, but
  20. it doesn't.
  21.  
  22.     The code itself may turn out to be interesting.  I wrote the
  23. entire program in two days, but I tried to keep things clean and
  24. modular.  Any comments on the code, either positive or constructive
  25. criticism, is welcome.
  26.  
  27.     On to the program.  I'm going to describe operation of the
  28. program starting in the upper left hand corner and proceeding across
  29. and down.  I will not describe the operation of the blitter.
  30.  
  31.     The large dark area in the upper left is the bit map we are
  32. going to play with.  It has a width of 96 bits, or 12 bytes, or 6
  33. words.  It has a height of 32 rows.  Remember these numbers well.
  34. You can draw in this area with the mouse and the two gadgets in the
  35. upper right.  The topmost gadget is the Point/Box gadget.  When set
  36. to point, you can draw individual pixels on the screen by clicking on
  37. the pixels with the select button.  When set to box, you can draw a
  38. filled rectangle by clicking on the upper left hand pixel of the box you
  39. wish to draw with the select button, dragging the mouse and releasing
  40. the select button over the lower left hand pixel.  The next gadget is
  41. the Clear/Set gadget, allowing you to clear or set points.  Note that
  42. this is not a paint program, and the interaction speed may not be as
  43. fast as you are used to; no apologies.  It was only intended to draw
  44. bits for the blitter.
  45.  
  46.     Below these two gadgets are two numbers.  The adrs number
  47. holds the address of the word the cursor is currently pointing at,
  48. relative to the beginning of the bit array.  (It is written as, for
  49. instance, M+382, which means the address of the array plus 382 bytes.)
  50. The shift value is the pixel, numbered from 0 at the left to 15 at the
  51. right.  With these values, you can point at a pixel to get its address
  52. to enter into a string gadget below.
  53.  
  54.     The Calc gadget looks at the values you have entered for the
  55. blitter, and determines if any memory other than the bit array will be
  56. modified.  If it will, it prints `Blit unsafe' on the title bar.  This
  57. is a sanity check to keep you from crashing the system.  Carefully check
  58. your values if this flag is on.  The fact that this gadget writes `Blit
  59. unsafe' does not necessarily mean that the blit will destroy memory
  60. outside of the array; careful use of a source operand and mask bits
  61. might not pass this test but would be perfectly okay.  I have
  62. allocated several extra rows above and below the bit array so minor
  63. errors shouldn't crash the system.  Currently line mode is not checked,
  64. so use it with care.
  65.  
  66.     The GO gadget performs the blit you have indicated.  After the
  67. blit, the results are updated in the magnified bit array rather slowly.
  68. It performs the same check performed by Calc before executing, and
  69. complains similarly.  You can override the complaint by clicking on the
  70. GO gadget again.
  71.  
  72.     Underneath the magnified bit map, on the left, are four gadgets
  73. labeled SX, SY, EX, and EY.  These bits get the starting and ending
  74. points for the line you wish to draw.  The X values should range from
  75. 0 to 95; the Y values from 0 to 31.  These are not checked.  Be aware
  76. that these are not blitter registers; they are simply values that the
  77. program will use in calculating the actual blitter register contents
  78. necessary for the line draw.
  79.  
  80.     The (line)/LINE gadget turns on line mode.  The Setup gadget
  81. takes the SX/SY/EX/EY values, and sets up most of the blitter registers
  82. to draw the line automatically.  It does not set up the function
  83. register, because there are different ways to draw lines.  For a solid
  84. line, use ~AC+A; for a textured line, use ~AC+AB; for an XOR line, use
  85. ~AC+A~C, for instance.  It does not perform the blit, however.  Note
  86. that if you want to draw a new line, you need to change the appropriate
  87. SX/SY/EX/EY values, then click Setup, then click GO.
  88.  
  89.     The next two gadgets, W and H, hold the size of the current
  90. blit.  The W value is in words, and the H value is in bytes.  Legal
  91. values range from 1-64 for W, and 1-1024 for H.  (Of course, the useful
  92. range within this program is much smaller.)
  93.  
  94.     Next to the H gadget are gadgets for the DESC, FCI, IFE, and
  95. EFE bits of the gadget.  These can get set or cleared by selecting them.
  96. Underneath these gadgets is the Function gadget.  In this gadget you
  97. enter the function you want to perform.  0 is clear all, 255 is set all,
  98. and other combinations can be entered directly as minterms.  For
  99. instance, the A~C+~CA presented earlier means exclusive or the A and C
  100. bits for the destination.
  101.  
  102.     The lower right hand corner contains the actual blitter registers
  103. and their values in hexadecimal.  These are the values that are fed to
  104. the blitter when you select GO.  As you enter new numbers into the string
  105. gadgets corresponding to blitter registers, these values will change to
  106. reflect the new values.  (Actually, they will only change if you hit
  107. carriage return after entering the numbers into the string gadget; if you
  108. simply select another gadget after entering data into a string gadget, the
  109. old value will stay displayed until you select CALC or GO.)  This can be
  110. used to calculate minterms, for instance.  Entering ABC+A~B~C+~AB~C+~A~BC
  111. into the Function gadget hitting return will put 96 in the least
  112. significant eight bits of CON0; this is the hexadecimal value reflecting
  113. the above minterms.
  114.  
  115.     At the lower right is a table of string gadgets.  Each row is for
  116. a single DMA channel.  The first column is the USE bit; is that channel
  117. on or off?  Y means on, N means off; selecting the gadget toggles it.  The
  118. next column contains the start address for DMA.  These numbers (as in the
  119. remaining string gadgets) can be entered in decimal, hexadecimal (preceded
  120. by a $), binary (preceded by a %), or as an offset from the start of the bit
  121. array (preceeded by M+).  M alone represents the beginning of the blit
  122. array.  The third column is the modulo value which is added to the DMA
  123. channel pointer at the end of each row; this value is in bytes and can be
  124. negative.  The fourth column is the data register; if a channel is turned
  125. off, its data register can be preloaded with a value, and then it functions
  126. as a constant.  For instance, to fill a block of memory with the value
  127. $E931, simply preload the A data register with this value, turn on only the
  128. D channel, and blit with the function A.  Finally, the last column is the
  129. amount to shift the A and B operands, to the right, before using them.
  130. Finally, in the lower left corner of the DMA channel box are string gadgets
  131. for AFWM and ALWM.
  132.  
  133.     This program has been tested fairly carefully.  Therefore, if the
  134. blitter appears to do something it shouldn't, you probably have set up the
  135. registers wrong.  Remember, the Amiga blitter is a word blitter, not a bit
  136. blitter.  It can be made to look like a bit blitter with some work.  It is
  137. possible, however, that errant blits can muck up some system memory, or
  138. some internal variable memory, so if things really seem awry, reboot and
  139. go back into the program.  Try the same values again, and see if they work
  140. this time.
  141.  
  142.     Blitter documentation is not included here currently.  Sometime
  143. in the next week I will finish my blitter documentation; that documentation
  144. will tell you more than you ever wanted to know about the blitter.  So,
  145. until then, I remain:
  146.  
  147. Tomas Rokicki
  148. Box 2081
  149. Stanford, CA  94305
  150. 723-1646 (office), 326-5312, -5681 (home)
  151. rokicki@sushi.stanford.edu
  152. ...lll-crg!decwrl!sushi.stanford.edu!rokicki
  153.